/**
 * Copyright (c) 2016-2019 人人开源 All rights reserved.
 *
 * https://www.renren.io
 *
 * 版权所有，侵权必究！
 */

package cc.ls51.common;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;

/**
 * 查询参数
 */
public class Query<T> {

    public IPage<T> getPage(Integer pageNumber,Integer pageSize) {
        //分页参数
        long curPage = 1;
        long limit = 10;

        if(null!=pageNumber && pageNumber >0){
            curPage = pageNumber;
        }
        if(null != pageSize && pageSize > 0){
            limit = pageSize;
        }

        //分页对象
        Page<T> page = new Page<>(curPage, limit);
        return page;
    }
}
